package com.xbts.screen.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.xbts.common.core.utils.DateUtils;
import com.xbts.common.core.web.domain.BaseHistogramResult;
import com.xbts.screen.domain.dto.WorkshopTrendDTO;
import com.xbts.screen.domain.vo.WorkshopRateVO;
import com.xbts.screen.domain.vo.WorkshopTrendVO;
import com.xbts.screen.domain.workshop.dto.CommonQueryDTO;
import com.xbts.screen.mapper.AssayMapper;
import com.xbts.screen.service.IAssayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 药水化验品质
 */
@Service
public class AssayServerImpl implements IAssayService {

    @Autowired
    private AssayMapper assayMapper;

    @DS("wecan")
    @Override
    public WorkshopTrendVO thicknessTrend() {
        CommonQueryDTO dto = new CommonQueryDTO();
        List<String> last30DaysRange = DateUtils.getLast30DaysRange();
        dto.setStartTime(last30DaysRange.get(0));
        dto.setEndTime(last30DaysRange.get(1));
        List<WorkshopTrendDTO> dtoList = assayMapper.thicknessTrend(dto);
        return new WorkshopTrendVO(dtoList);
    }

    @DS("wecan")
    @Override
    public WorkshopTrendVO UC2Trend() {
        CommonQueryDTO dto = new CommonQueryDTO();
        List<String> last30DaysRange = DateUtils.getLast30DaysRange();
        dto.setStartTime(last30DaysRange.get(0));
        dto.setEndTime(last30DaysRange.get(1));
        List<WorkshopTrendDTO> dtoList = assayMapper.UC2Trend(dto);
        return new WorkshopTrendVO(dtoList);
    }

    @DS("wecan")
    @Override
    public WorkshopTrendVO proportionTrend() {
        CommonQueryDTO dto = new CommonQueryDTO();
        List<String> last30DaysRange = DateUtils.getLast30DaysRange();
        dto.setStartTime(last30DaysRange.get(0));
        dto.setEndTime(last30DaysRange.get(1));
        List<WorkshopTrendDTO> dtoList = assayMapper.proportionTrend(dto);
        return new WorkshopTrendVO(dtoList);
    }

    @DS("wecan")
    @Override
    public WorkshopTrendVO gelRemovalRateTrend() {
        CommonQueryDTO dto = new CommonQueryDTO();
        List<String> last30DaysRange = DateUtils.getLast30DaysRange();
        dto.setStartTime(last30DaysRange.get(0));
        dto.setEndTime(last30DaysRange.get(1));
        List<WorkshopTrendDTO> dtoList = assayMapper.gelRemovalRateTrend(dto);
        return new WorkshopTrendVO(dtoList);
    }

    @DS("wecan")
    @Override
    public WorkshopTrendVO microCorrosionRateTrend() {
        CommonQueryDTO dto = new CommonQueryDTO();
        List<String> last30DaysRange = DateUtils.getLast30DaysRange();
        dto.setStartTime(last30DaysRange.get(0));
        dto.setEndTime(last30DaysRange.get(1));
        List<WorkshopTrendDTO> dtoList = assayMapper.microCorrosionRateTrend(dto);
        return new WorkshopTrendVO(dtoList);
    }

    @DS("wecan")
    @Override
    public WorkshopTrendVO depositionRateTrend() {
        CommonQueryDTO dto = new CommonQueryDTO();
        List<String> last30DaysRange = DateUtils.getLast100DaysRange();
        dto.setStartTime(last30DaysRange.get(0));
        dto.setEndTime(last30DaysRange.get(1));
        List<WorkshopTrendDTO> dtoList = assayMapper.depositionRateTrend(dto);
        return new WorkshopTrendVO(dtoList);
    }

    @Override
    public BaseHistogramResult firstInspectionPassRateTrend() {
        return null;
    }

    @Override
    public BaseHistogramResult secondaryInspectionPassRateTrend() {
        return null;
    }

    @Override
    public List<WorkshopRateVO> OSP_Rate() {
        return null;
    }

    @Override
    public List<WorkshopRateVO> etchingSolutionRate() {
        return null;
    }

    @Override
    public List<WorkshopRateVO> lineDevelopmentRate() {
        return null;
    }

    @Override
    public List<WorkshopRateVO> solderMaskDevelopmentRate() {
        return null;
    }

    @Override
    public List<WorkshopRateVO> cleaningLineRate() {
        return null;
    }

    @Override
    public List<WorkshopRateVO> linePreProcessingRate() {
        return null;
    }

    @Override
    public List<WorkshopRateVO> solderMaskPreProcessingRate() {
        return null;
    }

    @Override
    public List<WorkshopRateVO> PTH_Rate() {
        return null;
    }

    @Override
    public List<WorkshopRateVO> PTH_SecondaryRate() {
        return null;
    }

    @Override
    public List<WorkshopRateVO> platingRate() {
        return null;
    }
}